** !Kabale **
A RISC OS Desktop Patience game
by Olav Reinert 16.6.1990-20.8.1990


*** Internal representation of cards ***

  Cards are represented by numbers in the range 0 to 51, thereby assigning
every card a unique number. What card is assigned to each number can be derived in the following way (card% is the card number):

    card% MOD 13 = card colour (range 0-3)
    card% DIV 13 = card value (range 0-12)
                                          
The card colours have the following assignments:
   0=spade, 1=heart, 2=club, 3=diamond

The card values have the following assignments:
   Card value         0   1   2   3   4   5   6   7   8   9   10   11   12
   Card type         Ace  2   3   4   5   6   7   8   9  10  Jack Queen King


*** Global "system" variables: ***

taskHD%:
  The task handle when the program is running.
windowHD%:
  The window handle to the window used.
iconHD%:
  Icon handle for application icon on icon bar.
p% (len 256):
  Area of memory for Wimp_Poll data.
sprites% (len 21000):
  The sprite area holding all the card sprites. Set up by the program.
menu% (len 110):
  Area used for setting up the menu in the program.
infodata% (len 170):
  Contains the indirected data in the "About this program" display.
path$:
  Holds the pathname to the application directory.
workmaxX%:
  Maximum X-coord. of window work area.
workminY%:
  Minimum Y-coord. of window work area.
width%,height%:
  Hold the size of the window work area, positive numbers.
mode%:
  What mode the program is currently operating under. Updated every time the
  WIMP mode changes.
scalefacs%,pixtrans%:
  Pointers to the tables containing the scale factors and pixel translation
  tables required for mode independent plotting of dragged card sprites.
  Updated every time the WIMP mode changes.
xDragLimit%,yDragLimit%:
  Hold the maximum limits of the parent box (=the whole screen) when
  dragging. Derived from certain OS_ReadModeVariables. Updated every time
  the WIMP mode changes.

*** Global game variables ***

hand$:
  String containing cards on the hand
stack$(3):
  Index range: ([0-3])
  The cards on the 4 card stacks.
sticon%(3,3):
  Index ranges: ([0-3],[0-3])
  Holds the icon handles for the icons used for displaying the up to 4 cards
  in the stacks.
row$(3):
  Index range: ([0-3])
  The cards placed in the 4 rows.
rowicon%(3,12):
  Index ranges: ([0-3],[0-12])
  The icon handles for the up to 13 cards displayed on each of the 4 rows.
rowcol%(3):
  Index range: ([0-3])
  The card colour for each of the 4 rows.
basecard$:
  The base card, the same as the first char. in row$(0).
basecol%:
  The colour of the base card, =rowcol%(0)
baseval%:
  The card value of the basecard.
hptr%:
  Points at the card in hand$ that is to be dealt the next time. Thus,
  hptr%-1 points at the hand card that can be taken and dragged to one of
  the rows. When all hand cards have been dealt, it equals LEN(hand$)+1.
hcnt%:
  Counts the number of hand cards shown. Normally this is 3, as only the
  last 3 cards taken from the hand are shown at a time.
hnicon%:
  Icon handle for the hand card/hand empty icon.
tbicon%(2):
  Index range: ([0-2])
  Icon handles for the up to 3 hand cards shown at any time.
drag%:
  When dragging cards, this variable is set to indicate where the card was
  dragged from:   0,1,2,3: From one of the stacks
                  4:       From the hand
